<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>财务试算平衡</title>
	<include file="Public:header" />
	<style type="text/css">
		.input{width:150px;border:1px solid #ccc;padding:2px;}
	</style>
	<script type="text/javascript">
		var actflg="{:C('URL_MODEL')}"=="0"?"&":"?";
		
		function selectall_todo()
		{
			$("input[name='chk_list']").attr("checked",true);
		}
		function selectall_undo()
		{
			$("input[name='chk_list']").attr("checked",false);
		}
	</script>
</head>
<body class="">
	<div class="demo-info space-out-5px">
		<div class="demo-tip icon-tip"></div>
		<div>财务试算平衡</div>
		<div>
		<form id="frm_search" method="post" action="{:U('Finance/trial_balance')}" style="margin:10px auto 0px 25px;">
		年度：<input type="text" id="f_year" name="f_year" class="input" value="{$f_year}" />
		月份：<input type="text" id="f_period" name="f_period" class="input" value="{$f_period}" />
		<a href="javascript:;" class="easyui-linkbutton" iconCls="icon-search" onclick="$('#frm_search').submit();">搜索</a>
		<php>
		$firstday = date('Y-m-01', strtotime($f_year.'-'.$f_period)); 
		$lastday = date('Y-m-d', strtotime($firstday.'+1 month -1 day'));
		</php>
		</form>
		</div>
	</div>
	
	<div class=" space-out-10px">
	
	<div class="list-title">
		<div class="list-t-l w80px">会计科目</div>
		<div class="list-t-l w200px">科目名称</div>
		<div class="list-t-l w100px" style="text-align:right;">期初</div>
		<div class="list-t-l w100px" style="text-align:right;">本期借</div>
		<div class="list-t-l w100px" style="text-align:right;">本期贷</div>
		<div class="list-t-l w100px" style="text-align:right;">期末</div>
		<div class="list-t-l w100px" style="text-align:center;">科目明细</div>
		<div class="list-t-r">
		<a href="{:U('Finance/trial_balance')}" class="easyui-linkbutton" iconCls="icon-reload">刷新</a>
		</div>
	</div>
	
	<div class="list-box">
	<php>$total_dr=0;$total_cr=0;</php>
	<volist name="datalist" id="datalist">
	<div class="list-body">
		<div class="list-t-l w80px">{$datalist.acc_code}</div>
		<div class="list-t-l w200px" alt="{$datalist.acc_title}" title="{$datalist.acc_title}">{$datalist.acc_title}</div>
		<div class="list-t-l w100px" style="text-align:right;">{$datalist.opening|get_round=###,2}</div>
		<div class="list-t-l w100px" style="text-align:right;">{$datalist.dr|get_round=###,2}</div>
		<div class="list-t-l w100px" style="text-align:right;">{$datalist.cr|get_round=###,2}</div>
		<div class="list-t-l w100px" style="text-align:right;">{$datalist.closing|get_round=###,2}</div>
		<div class="list-t-l w100px" style="text-align:center;"><a href="javascript:;" onclick="parent.addTab('凭证科目明细','{:U('Finance/vou_detail?acc_code='.$datalist['acc_code'].'&mas_fadate1='.$firstday.'&mas_fadate2='.$lastday.'')}');">查看明细</a></div>
	</div>
	<php>$total_dr+=(double)$datalist['dr'];$total_cr+=$datalist['cr'];</php>
	</volist>
	</div>
	
	<div class="list-title">
		<div class="list-t-l w80px"></div>
		<div class="list-t-l w200px"></div>
		<div class="list-t-l w100px"></div>
		<div class="list-t-l w100px" style="text-align:right;"><b><php>echo get_round($total_dr,2);</php></b></div>
		<div class="list-t-l w100px" style="text-align:right;"><b><php>echo get_round($total_cr,2);</php></b></div>
		<div class="list-t-l w100px"></div>
		<div class="list-t-r">
		<a href="{:U('Finance/trial_balance')}" class="easyui-linkbutton" iconCls="icon-reload">刷新</a>
		</div>
	</div>
	
	</div>
	
	<div class="demo-info space-out-5px">
		<div class="demo-tip icon-tip"></div>
		<div class="pages">&nbsp; 负数表示为贷方余额</div>
	</div>
</body>
</html>
